project(test)
cmake_minimum_required(VERSION 3.0)

set(CMAKE_BUILD_TYPE "Debug")
#set(CMAKE_BUILD_TYPE "Release")

add_definitions(-DLINUX)

add_definitions(-fPIC)
#add_definitions(-fvisibility=hidden)#适用于(隐式)动态链接库，避免符号冲突。

set(SRC_FILES 
    cppstd/main.cpp
)

set(BC_DIR ${PROJECT_BINARY_DIR}/../../encrypt_and_encode/block_cipher)

set(SRC_FILES_BC
    bc/bc.cpp
    
    ${BC_DIR}/xor16.cpp
    ${BC_DIR}/cb_cipher.cpp
    ${BC_DIR}/ecb_mode.cpp
    ${BC_DIR}/cbc_mode.cpp
    ${BC_DIR}/ctr_mode.cpp
    ${BC_DIR}/fb_mode.cpp
    ${BC_DIR}/gcm_mode.cpp
)

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)

link_directories(${PROJECT_BINARY_DIR}/../../common/build/lib)
link_directories(${PROJECT_BINARY_DIR}/../../encrypt_and_encode/block_cipher/build/lib)

#add_executable(test ${SRC_FILES})
#target_link_libraries(test libcommon.a)

add_executable(test_bc ${SRC_FILES_BC})
target_link_libraries(test_bc crypto libcommon.a)#block_cipher
